package com.otitan.la.forest.industry.client.http;

import com.alibaba.fastjson.JSON;
import com.otitan.la.forest.industry.client.http.methods.AbstractHttpClient;
import org.apache.http.entity.StringEntity;

import java.nio.charset.StandardCharsets;
import java.util.Map;

/**
 * @Description: HttpClient
 * @Author: jiachangsen
 * @CreateDate: 2020/10/15 11:31
 * @UpdateUser: jiacs
 * @UpdateDate: 2020/10/15 11:31
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public class HttpPostJSON extends AbstractHttpClient {

    public HttpPostJSON(String path, String token, Object params) {
        super(path, token, params);
    }

    @Override
    public void execute() {
        StringEntity entity = new StringEntity(JSON.toJSONString(params), StandardCharsets.UTF_8);
        postRequest(CONTENT_TYPE_JSON, entity);
    }
}
